<?php
include_once('common/header.php');
if($AppUI->id <= 0 || (isset($_SESSION['slideshow']) && (($_SESSION['slideshow']&1<<3)==0))) {
	$this->_redirect(HOST_BACKEND);
}
$intType 		= $objRequest->getParam('type', EDUCATION_TYPE);
$intImageId 	= $objRequest->getParam('imgid', 0);
$intAlbumId 	= $objRequest->getParam('albumid', 0);
$arrErr			= null;
$intError		= 0;
if($intImageId && $intAlbumId) {
	$objSlideshow	= new Slideshow();
	$intError		= $objSlideshow->deleteImage($AppUI->id, $intImageId, $intAlbumId, $intType);
	if($intError > 0){
		$arrErr		= $arrError['noperm_upload_delete'];
	} else {
		Ecore_Function::setMsg($arrMessage['upload_delete']);
	}
} else {
	$arrErr			= $arrError['nodata_act'];
}
if(isset($arrErr)) {
	Ecore_Function::setError($arrErr);	
}
$this->_redirect(isset($_SESSION[SESSION_BACKURL]) ? $_SESSION[SESSION_BACKURL] : (HOST_BACKEND . 'slideshow?type=' . $intType));